﻿<cfcomponent>
	<cffunction access="remote" name="testOptions" returnformat="JSON" returntype="Array">
		<cfargument name="selectType" required="true" type="numeric">

		<cfset var A = arrayNew(1)>
		<cfset var B = arrayNew(1)>
		<cfset var dud = arrayNew(1)>
		<cfset var I = 0>
		<cfset var thisItem = arrayNew(1)>

		<cfloop from="1" to="3" index="I">
			<cfset thisItem[1] = I>
			<cfset thisItem[2] = I>

			<cfset arrayAppend(A, I)>
			<cfset arrayPrepend(B, I)>
		</cfloop>

		<cfswitch expression="#arguments.selectType#">
			<cfcase value="1">
				<cfreturn A>
			</cfcase>
			<cfcase value="2">
				<cfreturn B>
			</cfcase>
			<cfdefaultcase>
				<cfreturn dud>
			</cfdefaultcase>
		</cfswitch>
	</cffunction>
</cfcomponent>